home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 235 / Issue 235 - September 2007 - DPCS0907DVD.ISO / Extras / NetObjects Fusion / NOF10.exe / data1.cab / FSI / lib / nof / net / HttpResponse.js < prev    next >
Encoding:
Text File  |  2007-04-11  |  2.0 KB  |  87 lines

  1. /****i* SOURCE_FILE/INFO
  2.   *
  3.   * NAME
  4.   *  HttpResponse.js
  5.   *
  6.   * USAGE
  7.   *  Part of Netobjects JavaScript Library.
  8.   *
  9.   * COPYRIGHT
  10.   *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.   *  All Rights Reserved.
  12.   *
  13.   *  This is an unpublished work protected by Website Pros, Inc.
  14.   *  as a trade secret, and is not to be used or disclosed except as
  15.   *  expressly provided in a written license agreement executed by
  16.   *  you and Website Pros, Inc.
  17.   *
  18.   *      <copyright@websitepros.com>
  19.   *
  20.   * NOTES
  21.   *  JavaScript code.
  22.   *
  23.   *****/
  24.  
  25. if (!IS_isModuleInitialized("IS.NOF.NET.HttpResponse"))
  26. {
  27.   
  28.   /****h* NOF_JavaScript_Library/NOF.NET.HttpResponse
  29.     *
  30.     * NAME
  31.     *  NOF.NET.HttpResponse
  32.     *
  33.     * DESCRIPTION
  34.     *    
  35.     *
  36.     ****/
  37.   
  38.   /**
  39.     * Constructor
  40.     */
  41.   function NET_HttpResponse () {
  42.     this.__proto__ = NET_HttpResponse.prototype;
  43.     
  44.     this.URL = null; 
  45.     
  46.     this.headers = new Array();        
  47.     this.content = null;
  48.     
  49.     this.statusCode = -1;
  50.   }
  51.   {
  52.     var member = NET_HttpResponse.prototype;    
  53.     member.CLASS_NAME            = "NET.HttpResponse";
  54.     
  55.     var method = NET_HttpResponse.prototype;                            
  56.     
  57.     /**
  58.     * Get header value
  59.     * @return the header for headerName
  60.     **/   
  61.     method.getHeader = function (/*String*/ headName) { return this.headers[headName.toLowerCase()]; }
  62.     
  63.     /**
  64.     * Get all headers values
  65.     * 
  66.     * @return the list of headers, as an Array indexed by headerName's
  67.     **/        
  68.     method.getHeaders = function () { return this.headers; }
  69.     
  70.     /**
  71.     * Get response content
  72.     * 
  73.     * @return a String containing the content of the response
  74.     **/        
  75.     method.getContent = function () { return this.content; }        
  76.  
  77.     /**
  78.     * Get return status-code value
  79.     * 
  80.     * @return status code returned by the server (ie. 200 for OK, 404 for Object Not Found, etc)
  81.     **/        
  82.     method.getStatusCode = function () { return this.statusCode; }
  83.     
  84.   }
  85.   
  86.   NET.__proto__.HttpResponse = NET_HttpResponse;
  87. }